//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_AddressReuseMode_H
#define Green_AddressReuseMode_H

#include "Defines.h"
#include "Enums.h"

namespace Green {

  /*!
    \class AddressReuseMode
    \brief Class to track which address reuse types are enabled.
  */
  class AddressReuseMode {
  public:
    AddressReuseMode(); //!< Default constructor
    AddressReuseMode(const AddressReuseMode& rOther);
    DESTRUCTOR_DEFAULT(AddressReuseMode); //!< Destructor
    ASSIGNMENT_OPERATOR_ABSENT(AddressReuseMode);

    void EnableReuseType(const EAddressReuseType addrReuseType) { mModeBits |= EAddressReuseTypeBaseType(addrReuseType); } //!< Enable the specified reuse type.
    void DisableReuseType(const EAddressReuseType addrReuseType) { mModeBits &= ~EAddressReuseTypeBaseType(addrReuseType); } //!< Disable the specified reuse type.
    void DisableAllReuseTypes(); //!< Disable all reuse types.
    bool IsReuseTypeEnabled(const EAddressReuseType addrReuseType) const; //!< Return whether the specified reuse type is enabled.
  private:
    EAddressReuseTypeBaseType mModeBits; //!< Bits representing which reuse types are enabled
  };

}

#endif  // Green_AddressReuseMode_H
